package com.ac.api.component.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ac.api.component.entity.CpLabel;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ac.api.component.vo.CpLabelVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author gjj
 * @since 2024-10-26
 */
public interface CpLabelMapper extends BaseMapper<CpLabel> {

    /**
     * 根据模块名称和标签名称查询标签ID
     *
     * @return
     */
    CpLabelVo findByName(@Param("moudleName") String moudleName, @Param("labelName") String labelName);
    /**
     * 条件查询
     *
     * @param page
     * @param queryWrapper
     * @return
     */
    List<CpLabelVo> findByExample(@Param(Constants.WRAPPER) QueryWrapper<CpLabelVo> queryWrapper, Page page);

    /**
     * 根据id查询Label
     *
     * @param id
     * @return
     */
    CpLabelVo findLabelById(@Param("id")Integer id);

}
